﻿@using EC.Entity.Enum;
@{
    Layout = "~/Views/Shared/_Dialog.cshtml";
}
@model EC.Entity.Response.Merchant.MerchantResponse
<section class="container-fluid" style="background-color: white;">
    <form class="form-horizontal m15_t" id="form">
        <div class="tab-content">
            <div class="tab-pane fade in active" id="home">
                <input type="hidden" id="Id" name="merchantId" value="@(Model.Id)">
                <div class="form-group">
                    <label class="wd100 control-label">商户：</label>
                    <div class="wd250">
                        <div style="margin-top:8px;m">
                            <span style="font-weight:bold;">@(Model.Name)</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label">余额：</label>
                    <div class="wd250">
                        <div style="margin-top:8px;m">
                            <span style="font-weight:bold;">@(Model.DepositBalance)</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>充值金额：</label>
                    <div class="wd250">
                        <input class="form-control" type="text" name="amount" maxlength="10" autocomplete="off">
                    </div>
                </div>
            </div>
        </div>
    </form>
</section>
@section footerScript{
    <script type="text/javascript">

        function save() {

            var cover = FlashPay.UI.Mask({
                obj: $("body"),
                opacity: 0.5
            });

            var data = $("#form").serializeJSON();

            FlashPay.Util.Ajax({
                type: "POST",
                url: "/Merchant/SaveRechargeFee",
                data: data,
                success: function (res) {
                    if (res.success) {
                        cover.Remove();
                        FlashPay.UI.DialogOpener().Tip_success("操作成功！");
                        FlashPay.UI.DialogOpener().doSearch();
                        FlashPay.UI.CloseDialog();
                    } else {
                        cover.Remove();
                        FlashPay.UI.Tip_short_warning("操作失败！" + res.message);
                    }
                },
                error: function (json) {
                    cover.Remove();
                    FlashPay.UI.Tip_warning("操作失败！请查看网络，请重试。");
                }
            });

        }
    </script>
}